SRC=$(wildcard ./src/*.cpp)
DIR=$(notdir $(SRC))
OBJ=$(patsubst %.cpp, ./obj/%.o, $(DIR))

TAR=$(TARGET)
$(TAR): $(OBJ)
	$(CXX) -o $@ $^ $(CXXFLAGS)
 
$(OBJ): ./obj/%.o:./src/%.cpp
	$(CXX) -c $^ -o $@ $(CXXFLAGS)


.PHONY:clean print
clean:
	@echo "Clean Project"
	-rm ./obj/*
	-rm ./out/*

print:
	@echo --------------------------------------------
	@echo "TAR: 		$(TAR)"
	@echo "CXX: 		$(CXX)"
	@echo "CXXFLAGS: 	$(CXXFLAGS)"
	@echo "DIR: 		$(DIR)"
	@echo "OBJ: 		$(OBJ)"
	@echo "SRC: 		$(SRC)"
	@echo --------------------------------------------


